package org.yefei.homeworkday23;

import java.text.SimpleDateFormat;
import java.util.Calendar;

public class Three {

	public static void main(String[] args) {
		// 3：学士后结业考试日期是每月倒数第二个周六上午，输出今年所有的考试日期
		// E:Day name in week
		// a:Am/pm marker
		SimpleDateFormat s = new SimpleDateFormat("yyyy/MM/dd E a");
		Calendar c = Calendar.getInstance();
		for (int i = 0; i < 12; i++) {
			c.set(Calendar.MONTH, i);// 1月到12月
			c.set(Calendar.DAY_OF_MONTH, 1);
			c.set(Calendar.DAY_OF_WEEK_IN_MONTH, -2);// 倒数第二个周六
			c.set(Calendar.HOUR_OF_DAY, 9);// 判断上午或下午
			c.set(Calendar.DAY_OF_WEEK, 7);// 周六
			System.out.println(s.format(c.getTime()));
		}

	}
}
